// Warm color palette - 与其他页面保持一致
$primary-color: #f59e0b;
$primary-dark: #d97706;
$primary-light: #fbbf24;
$secondary-color: #fcd34d;
$success-color: #10b981;
$warning-color: #f59e0b;
$danger-color: #ef4444;
$dark-color: #374151;
$gray-color: #6b7280;
$light-gray: #fef7f0;
$white: #ffffff;

// Shadows
$shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
$shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
$shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
$shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

.expiry-warning-page {
  padding-top:100px;
  min-height: 100vh;
  background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 50%, #fbbf24 100%);
  padding-bottom: 120px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;

  .top-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    box-shadow: $shadow-sm;
    position: sticky;
    top: 0;
    z-index: 100;

    .navbar-left {
      display: flex;
      align-items: center;
      gap: 12px;

      .back-icon {
        color: $gray-color;
        cursor: pointer;
        transition: all 0.2s ease;
        padding: 8px;
        border-radius: 8px;

        &:hover {
          color: $primary-color;
          background: rgba($primary-color, 0.1);
          transform: scale(1.1);
        }
      }

      .page-title {
        color: $dark-color;
        font-size: 40px;
        font-weight: 700;
        letter-spacing: 0.5px;
      }
    }

    .navbar-right {
      .nav-icon {
        color: $gray-color;
        cursor: pointer;
        transition: all 0.2s ease;
        padding: 8px;
        border-radius: 8px;

        &:hover {
          color: $primary-color;
          background: rgba($primary-color, 0.1);
          transform: scale(1.1);
        }
      }
    }
  }

  .warning-overview {
    text-align: center;
    padding: 32px;
    background: rgba(255, 255, 255, 0.85);
    margin: 24px;
    border-radius: 20px;
    box-shadow: $shadow-md;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;

    &::after {
      content: '';
      position: absolute;
      top: -50%;
      right: -10%;
      width: 300px;
      height: 300px;
      background: linear-gradient(135deg, rgba($primary-color, 0.1) 0%, rgba($secondary-color, 0.1) 100%);
      border-radius: 50%;
      pointer-events: none;
    }

    .overview-icon {
      font-size: 72px;
      margin-bottom: 20px;
      position: relative;
      z-index: 1;
    }

    .overview-title {
      font-size: 56px;
      font-weight: 800;
      color: $dark-color;
      margin-bottom: 12px;
      position: relative;
      z-index: 1;
      text-align: center;
      line-height: 1.2;
    }

    .overview-subtitle {
      font-size: 34px;
      color: $gray-color;
      line-height: 1.6;
      position: relative;
      z-index: 1;
      text-align: center;
    }
  }

  .warning-content {
    flex: 1;
    padding: 0 24px;
    max-height: calc(100vh - 300px);
  }

  .warning-section {
    margin-bottom: 32px;

    .section-header {
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 20px;
      padding: 24px;
      background: rgba(255, 255, 255, 0.85);
      border-radius: 20px;
      backdrop-filter: blur(10px);
      box-shadow: $shadow-md;
      position: relative;
      overflow: hidden;
      min-height: 80px;

      &::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, $danger-color, #f87171);
      }

      .section-icon {
        position: absolute;
        left: 24px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 32px;
        width: 64px;
        height: 64px;
        border-radius: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba($danger-color, 0.1);
        flex-shrink: 0;
      }

      .section-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        margin: 0 80px;

        .section-title {
          color: $dark-color;
          font-size: 36px;
          font-weight: 700;
          margin-bottom: 6px;
          text-align: center;
          line-height: 1.2;
        }

        .section-subtitle {
          color: $gray-color;
          font-size: 24px;
          font-weight: 500;
          text-align: center;
          line-height: 1.3;
        }
      }
    }

    .food-cards {
      display: flex;
      flex-direction: column;
      gap: 16px;
    }
  }

  .warning-food-card {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 20px;
    padding: 24px;
    box-shadow: $shadow-md;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;

    &::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 4px;
      transition: all 0.3s ease;
    }

    &.expiring {
      &::before {
        background: linear-gradient(90deg, $danger-color, #f87171);
      }

      &:hover {
        border-color: rgba($danger-color, 0.3);
        transform: translateY(-4px);
        box-shadow: $shadow-lg;
      }
    }

    &.low {
      &::before {
        background: linear-gradient(90deg, $warning-color, #fbbf24);
      }

      &:hover {
        border-color: rgba($warning-color, 0.3);
        transform: translateY(-4px);
        box-shadow: $shadow-lg;
      }
    }

    .card-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 20px;

      .food-basic-info {
        display: flex;
        align-items: center;
        gap: 16px;

        .food-emoji {
          font-size: 48px;
          width: 64px;
          height: 64px;
          display: flex;
          align-items: center;
          justify-content: center;
          background: rgba($primary-color, 0.1);
          border-radius: 16px;
          flex-shrink: 0;
        }

        .food-text-info {
          .food-name {
            font-size: 32px;
            font-weight: 700;
            color: $dark-color;
            margin-bottom: 8px;
          }

          .food-category {
            font-size: 22px;
            color: $gray-color;
            font-weight: 500;
          }
        }
      }

      .expiry-tag {
        border-radius: 24px;
        font-weight: 700;
        padding: 12px 20px;
        font-size: 24px;
        backdrop-filter: blur(10px);
        box-shadow: $shadow-sm;
        text-align: center;
        line-height: 1.2;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);

        &.expiring {
          background: linear-gradient(135deg, #dc2626, #b91c1c);
          color: white;
          border: 2px solid rgba(255, 255, 255, 0.2);
        }

        &.low {
          background: linear-gradient(135deg, #f59e0b, #d97706);
          color: white;
          border: 2px solid rgba(255, 255, 255, 0.2);
        }
      }
    }

    .card-details {
      display: flex;
      flex-direction: column;
      gap: 12px;
      margin-bottom: 20px;
      padding-bottom: 16px;
      border-bottom: 1px solid rgba($gray-color, 0.1);

      .detail-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 8px 12px;
        background: rgba($gray-color, 0.05);
        border-radius: 10px;
        transition: all 0.2s ease;

        &:hover {
          background: rgba($primary-color, 0.1);
          transform: translateX(4px);
        }

        .at-icon {
          color: $primary-color;
          width: 24px;
          height: 24px;
          display: flex;
          align-items: center;
          justify-content: center;
          border-radius: 6px;
          background: rgba($primary-color, 0.1);
        }

        .detail-text {
          font-size: 28px;
          color: $gray-color;
          font-weight: 500;
          flex: 1;
        }
      }
    }

    .card-actions {
      display: flex;
      gap: 16px;

      .action-button {
        flex: 1;
        border-radius: 12px;
        font-size: 20px;
        font-weight: 600;
        padding: 16px 24px;
        transition: all 0.2s ease;

        &.priority {
          background: linear-gradient(135deg, $danger-color, #dc2626);
          border: none;
          color: white;
          box-shadow: 0 4px 14px 0 rgba(239, 68, 68, 0.25);

          &:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px 0 rgba(239, 68, 68, 0.35);
          }
        }
      }
    }
  }

  .no-warning {
    text-align: center;
    padding: 48px 32px;
    background: rgba(255, 255, 255, 0.85);
    margin: 24px;
    border-radius: 20px;
    box-shadow: $shadow-md;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;

    &::after {
      content: '';
      position: absolute;
      top: -50%;
      right: -10%;
      width: 300px;
      height: 300px;
      background: linear-gradient(135deg, rgba($success-color, 0.1) 0%, rgba($primary-color, 0.1) 100%);
      border-radius: 50%;
      pointer-events: none;
    }

    .no-warning-icon {
      font-size: 96px;
      margin-bottom: 24px;
      position: relative;
      z-index: 1;
    }

    .no-warning-title {
      font-size: 56px;
      font-weight: 800;
      color: $dark-color;
      margin-bottom: 16px;
      position: relative;
      z-index: 1;
    }

    .no-warning-subtitle {
      font-size: 34px;
      color: $gray-color;
      margin-bottom: 12px;
      line-height: 1.6;
      position: relative;
      z-index: 1;
    }

    .no-warning-desc {
      font-size: 24px;
      color: $gray-color;
      margin-bottom: 32px;
      line-height: 1.5;
      position: relative;
      z-index: 1;
    }

    .back-to-kitchen-btn {
      background: linear-gradient(135deg, $primary-color, $primary-dark);
      border: none;
      color: white;
      border-radius: 50rpx;
      padding: 20px 40px;
      font-size: 24px;
      font-weight: 600;
      box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
      transition: all 0.3s ease;
      position: relative;
      z-index: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      line-height: 1.2;
      min-height: 64px;
      width: 100%;
      
      // 确保按钮内容居中
      .at-button__text {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        text-align: center;
        line-height: 1.2;
        color: white;
        font-size: 24px;
        font-weight: 600;
      }

      &:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 25px rgba(245, 158, 11, 0.4);
      }
    }
  }

  .bottom-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    padding: 24px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    display: flex;
    gap: 16px;

    .bottom-action-btn {
      flex: 1;
      border-radius: 12px;
      padding: 18px 24px;
      font-weight: 600;
      font-size: 20px;
      transition: all 0.2s ease;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      line-height: 1.2;
      min-height: 56px;

      &.secondary {
        background: rgba($gray-color, 0.1);
        color: $gray-color;
        border: none;

        &:hover {
          background: rgba($gray-color, 0.2);
        }
      }

      &:not(.secondary) {
        background: linear-gradient(135deg, $primary-color, $primary-dark);
        border: none;
        color: white;
        box-shadow: 0 4px 14px 0 rgba(245, 158, 11, 0.25);

        &:hover {
          transform: translateY(-2px);
          box-shadow: 0 6px 20px 0 rgba(245, 158, 11, 0.35);
        }
      }
    }
  }
}

// Taro UI 组件样式覆盖
.at-button {
  &.at-button--small {
    height: 40px;
    line-height: 40px;
    font-size: 16px;
  }
}

.at-tag {
  &.at-tag--small {
    height: 28px;
    line-height: 28px;
    font-size: 14px;
    padding: 0 12px;
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .expiry-warning-page {
    .warning-overview {
      margin: 16px;
      padding: 24px;
    }

    .warning-content {
      padding: 0 16px;
    }

    .warning-section .section-header {
      padding: 20px;
    }

    .warning-food-card {
      padding: 20px;
    }

    .no-warning {
      margin: 16px;
      padding: 32px 24px;
    }

    .bottom-actions {
      padding: 20px 16px;
    }
  }
}

@media (max-width: 480px) {
  .expiry-warning-page {
    .top-navbar {
      padding: 12px 16px;

      .navbar-left .page-title {
        font-size: 28px;
      }
    }

    .warning-overview {
      .overview-title {
        font-size: 36px;
      }

      .overview-subtitle {
        font-size: 24px;
      }
    }

    .warning-section .section-header {
      .section-title {
        font-size: 24px;
      }

      .section-subtitle {
        font-size: 18px;
      }
    }

    .warning-food-card {
      .card-header .food-basic-info .food-text-info {
        .food-name {
          font-size: 24px;
        }

        .food-category {
          font-size: 18px;
        }
      }

      .card-details .detail-item .detail-text {
        font-size: 24px;
      }
    }

    .no-warning {
      .no-warning-title {
        font-size: 36px;
      }

      .no-warning-subtitle {
        font-size: 24px;
      }

      .no-warning-desc {
        font-size: 18px;
      }
    }
  }
}

/* 加载动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.warning-food-card {
  animation: fadeIn 0.5s ease-out;
}

.warning-food-card:nth-child(1) { animation-delay: 0.05s; }
.warning-food-card:nth-child(2) { animation-delay: 0.1s; }
.warning-food-card:nth-child(3) { animation-delay: 0.15s; }
.warning-food-card:nth-child(4) { animation-delay: 0.2s; }
.warning-food-card:nth-child(5) { animation-delay: 0.25s; }
